<script setup>

import CryptoJS from 'crypto-js';
import router from '../../router'
import loginApi from "../../api/login.js";


const formData = reactive({
  userNameId: 'cni23118760',
  password: 'cni23@269538',
  "appVer":"2.2",
  "deviceSn":"55"
});

const login = () => {
  const params = {...formData};
  params.password = CryptoJS.MD5(params.password).toString();
  loginApi.login(params).then(res=>{
    if(res.statusCode === 200){
      router.push({name: 'out'});
    } else {
      alert("登录失败："+ res.message);
    }
  });
}


</script>

<template>
  用户名：<input type="text" v-model="formData.userNameId">
  <br>
  密码：<input type="password" v-model="formData.password"><button @click="login">登录</button>
</template>

<style scoped>

</style>